package com.liming.payment.client;

import com.liming.common.pojo.dto.payment.PaymentUpdateDTO;
import com.liming.common.pojo.dto.payment.PrepayDTO;
import com.liming.service.wx.pojo.vo.PrepayVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author liming
 * @date 2025/1/6
 */
@FeignClient(value = "payment-service", path = "/service/payment")
public interface PaymentClient {

    /**
     * 微信二次支付
     *
     * @param orderId 订单ID
     * @return PrepayVO
     */
    @GetMapping("wx_repay/{orderId}")
    PrepayVO wxRepay(@PathVariable Long orderId);

    /**
     * 微信预支付
     *
     * @param prepayDTO 预支付DTO
     * @return Boolean
     */
    @PostMapping("wx_prepay")
    Boolean wxPrepay(@RequestBody PrepayDTO prepayDTO);

    /**
     * 更新订单状态
     *
     * @return Boolean
     */
    @PutMapping("updateByOrderId")
    Boolean updateByOrderId(@RequestBody PaymentUpdateDTO paymentUpdateDTO);
}
